package com.jarvis.zeng.design.pattern.filter.datapermission;

import org.springframework.stereotype.Component;

/**
 * @author admin
 */
@Component
public class TimeFilter extends IMessageFilter{

    @Override
    public boolean doFilter(Message message) {
        if (message.getHour() < 10 || message.getHour() > 20) {
            System.out.println("hour < 10 或 hour > 20 已拦截...");
            return false;
        }
        System.out.println("time 已通过...");
        return true;
    }
}
